package com.augn;


import com.baomidou.mybatisplus.generator.FastAutoGenerator;

public class AutoCode {

    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/heavenly_creations?useSSL=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8", "root", "123456")
                .globalConfig(builder -> {
                    builder.author("augn") // 设置作者
                            .enableSwagger() // 开启 swagger 模式
                           // .fileOverride() // 覆盖已生成文件
                            .outputDir("D:\\app\\IntelliJ IDEA 2022.1\\Workspace\\classTest\\HeavenlyCreations\\src\\main\\java"); // 指定输出目录
                })
                .packageConfig(builder -> {
                    builder.parent("com.augn") // 设置父包名
                            .moduleName(null) // 设置父包模块名
                            .service("service")
                            .serviceImpl("service.impl")
                            .mapper("mapper")
                            .xml("mapper.xml")
                            .controller("controller");

                })
                .strategyConfig(builder -> {
                    builder.addInclude("Cultural_Heritage","Goods_Evaluate_From","Goods_Evaluate_Main","Investment_Progress","Post_Evaluate_From","Post_Evaluate_Main","Special_User") // 设置需要生成的表名
                            .addTablePrefix("t_", "c_"); // 设置过滤表前缀
                })
                //.templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板，默认的是Velocity引擎模板
                .execute();
    }


}
